home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mastering Web Site Development
/
Microsoft Mastering Web Site Development (Microsoft) (1997).iso
/
Labs
/
StateUFinal
/
profile.asp
< prev
next >
Wrap
Text File
|
1997-04-24
|
3KB
|
118 lines
<%@ LANGUAGE="VBSCRIPT" %>
<%
If Not (IsEmpty(Request("txtID"))) Then
'request came from Submit button on form
Session("username") = Request("txtName")
Session("id") = Request("txtID")
Session("major") = Request("Major")
If InStr(Session("requestedPage"), "profile") = 0 Then
response.redirect Session("requestedPage")
Else
response.redirect "default.htm"
End If
End If
%>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR"
content="Microsoft FrontPage (Visual InterDev Edition) 2.0">
<title>User Profile</title>
<link rel="STYLESHEET" href="Stylesheets/Grid/Style2.css">
<SCRIPT language=vbscript>
Sub Window_OnLoad()
Document.frmProfile.lstMajors.AddItem "Math"
Document.frmProfile.lstMajors.AddItem "Music"
Document.frmProfile.lstMajors.AddItem "History"
End Sub
Sub Submit_OnClick()
If IsNumeric(Document.frmProfile.txtID.Value) Then
If Document.frmProfile.txtID.Value >= 1 AND _
Document.frmProfile.txtID.Value <= 57 Then
'save the value of the combo box in the hidden control
frmProfile.Major.Value = frmProfile.lstMajors.Text
'submit the form data to the server
Document.frmProfile.Submit
Else
MsgBox "ID must be between 1 and 57."
End If
Else
MsgBox "ID must be numeric."
End If
End Sub
</SCRIPT>
</head>
<body background="Images/Grid/Background/Back2.jpg"
bgcolor="White">
<basefont face="Arial, Helvetica, sans-serif">
<!-- Page Header -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th align="Left" nowrap bgcolor="Silver"
background="./Images/Grid/Navigation/Nav1.jpg"> <font
size="6"> Student Profile </font> </th>
</tr>
<tr>
<td bgcolor="#FFFFCC"> <font size="-1">
Enter your Student ID, Name, and preferred Major </font> </td>
</tr>
</table>
<!-- end of page header -->
<P>
<%
If Not (IsEmpty(Request("txtID"))) Then
'request came from Submit button on form
username = Request("txtName")
id= Request("txtID")
major = Request("Major")
%>
Welcome, <%=username%>, to State University.
<P>I see you are interested in <%=major%>.
<% End If %>
<P>
<form NAME=frmProfile ACTION=profile.asp METHOD=Post>
<div align="left">
<table border="0" cellpadding="2">
<tr>
<td>ID</td>
<td><input type="text" size="20" name="txtID"></td>
</tr>
<tr>
<td>Name </td>
<td><input type="text" size="20" name="txtName"></td>
</tr>
<tr>
<td>Major </td>
<td><OBJECT ID="lstMajors" WIDTH=140 HEIGHT=24
CLASSID="CLSID:8BD21D30-EC42-11CE-9E0D-00AA006002F3">
<PARAM NAME="VariousPropertyBits" VALUE="746604571">
<PARAM NAME="DisplayStyle" VALUE="3">
<PARAM NAME="Size" VALUE="3704;635">
<PARAM NAME="MatchEntry" VALUE="1">
<PARAM NAME="ShowDropButtonWhen" VALUE="2">
<PARAM NAME="FontCharSet" VALUE="0">
<PARAM NAME="FontPitchAndFamily" VALUE="2">
<PARAM NAME="FontWeight" VALUE="0">
</OBJECT></td>
</tr>
<tr>
<td> </td>
<td><input type="button" name="Submit" value="Submit"></td>
</tr>
</table>
</div>
<INPUT TYPE=HIDDEN NAME=Major Value="">
</form>
</body>
</html>